﻿// DigitalDesign
// Project: InformationBoard
// Developer: Montak Oleg
// Created: 09.11.2011
// Last change: 16.11.2011
// Description: console host application - host all services

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace Server
{
    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost pingHost = new ServiceHost(typeof(PingService));
            ServiceHost scheduleHost = new ServiceHost(typeof(ScheduleService));
            ServiceHost videoHost = new ServiceHost(typeof(VideoService));
            ServiceHost callbackHost = new ServiceHost(typeof(CallbackService));
            ServiceHost crossDomainHost = new ServiceHost(typeof(CrossDomainService));
            ServiceHost adminHost = new ServiceHost(typeof(AdminService));
            ServiceHost clientSettingsHost = new ServiceHost(typeof(ClientSettingsService));

            pingHost.Open();
            scheduleHost.Open();
            videoHost.Open();
            callbackHost.Open();
            crossDomainHost.Open();
            adminHost.Open();
            clientSettingsHost.Open();
            Console.WriteLine("up and running");

            // test code here
            Tests.RunAllTests();

            Console.WriteLine("Press <Enter> to exit...");
            Console.ReadLine();

            pingHost.Close();
            scheduleHost.Close();
            videoHost.Close();
            callbackHost.Close();
            crossDomainHost.Close();
            adminHost.Close();
            clientSettingsHost.Close();
            Console.WriteLine("closed");
        }
    }
}
